﻿@model IEnumerable<HelpDeskTicketingApp.Models.AdmIssueViewModel>
@{
    ViewBag.Title = "Index";
    Layout = "~/Views/Shared/_Layout.cshtml";
}

<h2>Assigned Tickets</h2>

<div class="col-lg-11">

    <table id="TechTicketsTable" class="table table-bordered table-striped dataTable">
        <thead>
            <tr>
                <th>Reported By</th>
                <th>Issue Type</th>
                <th>Description</th>
                <th>Date Reported</th>
                <th >Date Resolved</th>
                <th></th>
            </tr>
        </thead>
        <tbody>
            @foreach (var i in Model)
            {
                <tr>
                    <td>@(i.User.FirstName + " " + i.User.LastName)</td>
                    <td>@i.IssueType.IssueTypeDesc</td>
                    <td>@i.IssueDesc</td>
                    <td>@i.DateReported</td>
                    <td class="@(i.DateResolved != null ? "alert alert-success" : "alert alert-warning")">
                    @(i.DateResolved != null ? i.DateResolved.ToString() : "Not Resolved !")</td>
                    <td>
                     
                        @Html.ActionLink("Other Techs |", "AssignmentDetails", new { id = i.IssueId })
                        @Html.ActionLink("Resolution", "Resolution", new { id = i.Resolution.ResolutionId })
                    </td>
                </tr>

            }

        </tbody>
    </table>
</div>


@section Scripts {
  

    
    
    <script>
        $(document).ready(function () {
            $('#TechTicketsTable').DataTable();
        });
    </script>>



}
